const obj = {
    name: 'test'
}

const newProxy = new Proxy(obj, {
    get(targer, property) {
        return property in targer ? targer[property] : 'default'
    },
    set(targer, property, value) {
        if (property === "age")
            if (!Number.isInteger(value))
                throw new TypeError("错误的数据类型")
        targer[property] = value
        console.log(targer)
    },
    delete(targer,property){
       delete targer[property]
    }
})
console.log(newProxy.name)
console.log(newProxy.xx)
newProxy.age = "哈哈"
// console.log(newProxy.age)